<%@ page import="entity.Computerroom" %>
<%@ page import="service.MachineroomService" %>
<%@ page import="service.impl.MachineroomServiceImpl" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="jQuery3.6.0.js"></script>
</head>
    <body>
    <%
        MachineroomService machineroomService = new MachineroomServiceImpl();
        List<Computerroom> list = machineroomService.SelectAll();
    %>
    <h1>学校机房管理系统</h1>
    <a href="AddPage.jsp">添加机房</a>
    <table border="1px">
        <tr>
            <th>序号</th>
            <th>机房名称</th>
            <th>计算机数量</th>
            <th>机房管理员</th>
            <th>机房位置</th>
            <th>机房状态</th>
            <th>操作</th>
        </tr>
        <%
            for (Computerroom computerroom : list){
        %>
        <tr>
            <th><%=computerroom.getRoomId()%></th>
            <th><%=computerroom.getRoomName()%></th>
            <th><%=computerroom.getComputerNumber()%></th>
            <th><%=computerroom.getManager()%></th>
            <th><%=computerroom.getLocation()%></th>
            <th><%=computerroom.getState()%></th>
            <th><a href="Delete_do.jsp?id=<%=computerroom.getRoomId()%>">删除</a></th>
        </tr>
        <%
            }
        %>
    </table>
</body>
</html>
